package com.sb.money.entities;

// Generated Dec 2, 2012 10:52:01 PM by Hibernate Tools 3.2.2.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * LkCompanyType generated by hbm2java
 */
@Entity
@Table(name = "lk_company_type"
        , catalog = "money"
        , uniqueConstraints = @UniqueConstraint(columnNames = "LK_COMPANY_TYPE_NAME"))
public class LkCompanyType implements java.io.Serializable {

    private static final long serialVersionUID = -6799919788481691042L;
    private Short lkCompanyTypeId;
    private String lkCompanyTypeName;
    private Set<Company> companies = new HashSet<Company>(0);

    public LkCompanyType() {
    }

    public LkCompanyType(String lkCompanyTypeName) {
        this.lkCompanyTypeName = lkCompanyTypeName;
    }

    public LkCompanyType(String lkCompanyTypeName, Set<Company> companies) {
        this.lkCompanyTypeName = lkCompanyTypeName;
        this.companies = companies;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "LK_COMPANY_TYPE_ID", unique = true, nullable = false)
    public Short getLkCompanyTypeId() {
        return this.lkCompanyTypeId;
    }

    public void setLkCompanyTypeId(Short lkCompanyTypeId) {
        this.lkCompanyTypeId = lkCompanyTypeId;
    }

    @Column(name = "LK_COMPANY_TYPE_NAME", unique = true, nullable = false)
    public String getLkCompanyTypeName() {
        return this.lkCompanyTypeName;
    }

    public void setLkCompanyTypeName(String lkCompanyTypeName) {
        this.lkCompanyTypeName = lkCompanyTypeName;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "lkCompanyType")
    public Set<Company> getCompanies() {
        return this.companies;
    }

    public void setCompanies(Set<Company> companies) {
        this.companies = companies;
    }

}
